﻿using System;
using System.Configuration;

namespace Xpus.Website.Configuration
{
	/// <summary>
	/// 表示Web.Config文件中的xpus配置节。
	/// </summary>
	public class XpusConfigurationSection : ConfigurationSection
	{
		private static XpusConfigurationSection _instance;

		/// <summary>
		/// 初始化XpusSection类型。
		/// </summary>
		static XpusConfigurationSection()
		{
			_instance = (XpusConfigurationSection)ConfigurationManager.GetSection("xpus");
		}

		/// <summary>
		/// 获取XpusSection的单个实例。
		/// </summary>
		public static XpusConfigurationSection Instance
		{
			get
			{
				return _instance;
			}
		}

		/// <summary>
		/// 获取xpus/mailServer节点下的配置。
		/// </summary>
		[ConfigurationProperty("mailServer")]
		public MailServerConfiguration MailServer
		{
			get
			{
				return (MailServerConfiguration)base["mailServer"];
			}
		}

		/// <summary>
		/// 获取xpus/language节点下的配置。
		/// </summary>
		[ConfigurationProperty("language")]
		public LanguageConfiguration Language
		{
			get
			{
				return (LanguageConfiguration)base["language"];
			}
		}

		/// <summary>
		/// 获取xpus/database节点下的配置。
		/// </summary>
		[ConfigurationProperty("database")]
		public DatabaseConfiguration Database
		{
			get
			{
				return (DatabaseConfiguration)base["database"];
			}
		}

		/// <summary>
		/// 获取xpus/regex节点下的配置。
		/// </summary>
		[ConfigurationProperty("regex")]
		public RegexConfiguration Regex
		{
			get
			{
				return (RegexConfiguration)base["regex"];
			}
		}
	}
}
